package com.opencv.enums;

/**
 * @author qz.wu
 * @date 2021/10/14 15:47
 * @descriptions TODO
 */
public enum ShoppingDetailEnum {
    GOOD_NAME("商品名称", "goodName"),
    ADDRESS("收货地址", "address"),
    RECEIVER("收件人", "receiver"),
    PHONE("手机号", "phone"),
    ORDER_ID("订单号", "orderId"),
    NUM("数量", "num"),
    ;

    private String columnName;

    private String fieldName;

    ShoppingDetailEnum(String columnName, String fieldName) {
        this.columnName = columnName;
        this.fieldName = fieldName;
    }

    public static ShoppingDetailEnum get(String columnName) {
        ShoppingDetailEnum[] values = ShoppingDetailEnum.values();
        for (ShoppingDetailEnum shoppingDetailEnum : values) {
            if (shoppingDetailEnum.getColumnName().equals(columnName)) {
                return shoppingDetailEnum;
            }
        }
        return null;
    }

    public String getColumnName() {
        return columnName;
    }

    public String getFieldName() {
        return fieldName;
    }
}
